package com.brand.prisd.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.RotateAnimation;
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

import com.brand.prisd.R;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * 添加设备页面
 */
public class AddDeviceActivity extends AppCompatActivity {

    @BindView(R.id.btn_confirm)
    Button btnConfirm;
    @BindView(R.id.tv_add_device)
    TextView tvAddDevice;
    @BindView(R.id.tv_marked_words)
    TextView tvMarkedWords;
    @BindView(R.id.iv_anim)
    ImageView ivAnim;
    @BindView(R.id.fl_container)
    FrameLayout flContainer;
    @BindView(R.id.tv_ViewHelp)
    TextView tvViewHelp;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_add_device);
        ButterKnife.bind(this);
        initView();
    }

    private void initView() {
        RotateAnimation rotateAnimation = new RotateAnimation(0f, 360f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
        rotateAnimation.setRepeatCount(Animation.INFINITE);
        rotateAnimation.setDuration(3000);
        rotateAnimation.setRepeatMode(Animation.REVERSE);
        ivAnim.startAnimation(rotateAnimation);
    }


    @OnClick(R.id.btn_confirm)
    public void onViewClicked() {
        go2WifiActivity();
    }

    private void go2WifiActivity() {
        startActivity(new Intent(this, WiFiActivity.class));
        finish();
    }

    @OnClick({R.id.iv_right_arrow, R.id.tv_compatibleMode, R.id.tv_ViewHelp})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.iv_right_arrow:
                finish();
                break;
            case R.id.tv_compatibleMode:
                Snackbar.make(view, "待开发...", Toast.LENGTH_SHORT).show();
                break;
            case R.id.tv_ViewHelp:
                Snackbar.make(view, "待开发...", Toast.LENGTH_SHORT).show();
                break;
        }
    }

}
